import { service } from "../http/request";

/**
 * 获取会议室数据
 */
const getRoomList = () => {
  return service({
    method: 'get',
    url: '/room/'
  })
}
/**
 *  获取
 */
const getApplyRecord = (roomId, localDate) => {
  return service({
    method: 'get',
    url: `/roomApply/getApplyRecord?roomId=${roomId}&localDate=${localDate}`,
  })
}

/**
 * 添加会议申请
 */
const addApply = (param) => {
  return service({
    method: 'post',
    url: '/roomApply/addApply',
    data: param
  })
}

/**
 * 我的申请
 */
const myApplyData = () => {
  return service({
    method: 'get',
    url: '/roomApply/myApplyData'
  })
}

/**
 * 获取待审批的申请记录
 */
const needApplyData = () => {
  return service({
    method: 'get',
    url: '/roomApply/needApplyData'
  })
}

/**
 * 审批处理
 */
const toApply  = (param) => {
  return service({
    method: 'put',
    url: '/roomApply/toApply',
    data: param
  })
}

export default {
  getRoomList,
  getApplyRecord,
  addApply,
  myApplyData,
  needApplyData,
  toApply
}
